package de.tum.in.eist.poll.shared.beans;

import java.io.Serializable;


/**
 * A sequence of questions for the user to answer.
 * 
 * @author The EIST-POLL-21 team.
 *
 */
public class QuestionGroup implements Serializable {
	
	/**
	 * serialization version
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * Map from question index to Question
	 */
	private Question[] questions;
	
	/**
	 * Dummy constructor for GWT. Don't ever use this.
	 */
	public QuestionGroup() {
		questions = new Question[0];
	}
	
	/**
	 * Initialize the QuestionGroup with a map of questions.
	 * The map maps the question identifier (also called index of that
	 * question) to a Question object.
	 * 
	 * @param questions The map of questions
	 */
	public QuestionGroup(Question[] questions) {
		this.questions = questions;
	}
	
	//TODO LONG: why did I let i=1,2,... before?
	/**
	 * @return The {@link Question} at the i-th position, i=0,1,... or
	 * 		   null if no Answer is available
	 */
	public Question get(Integer index) {
		return questions[index];
	}
	
	public Question[] getQuestions() {
		return questions;
	}
}
